﻿using System;

namespace Quail.DbLogger.Task
{
    public class DeleteTestRunTask : QuailDbLoggerEntry
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DeleteTestRunTask"/> class.
        /// </summary>
        /// <param name="testruntaskid">The testruntaskid.</param>
        public DeleteTestRunTask(long testruntaskid)
        {
            TestRunTaskId = testruntaskid;
        }

        private long TestRunTaskId { get; set; }

        /// <summary>
        /// Delets the test run task
        /// </summary>
        /// <param name="dataContext">the context to use</param>
        public override void Store(QuailServices.QuailDataServiceReference.QuailDataServiceClient dataContext)
        {
            dataContext.DeleteTestRunTask(TestRunTaskId);
        }

        /// <summary>
        /// Returns a string representation of the entry for logging purposes
        /// </summary>
        /// <returns>A log string</returns>
        public override string GetLogDetail()
        {
            return string.Format("DeleteTestRunTask({0})", TestRunTaskId);
        }
    }
}
